package com.core.mvc.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.core.mvc.Require;

/**
 * 服务提供者信息
 * 
 * @author 殷田
 *
 */
class ServiceBean
{
	private Object target;

	private Map< String, ActionBean > actions = new ConcurrentHashMap< String, ActionBean >();

	private IFilterHandler< Require > filterHandler;

	public void setTarget( Object target )
	{
		this.target = target;
	}

	public Object getTarget()
	{
		return target;
	}

	public void putAction( String key, ActionBean action )
	{
		if ( key != null && action != null && !actions.containsKey( key ) )
		{
			actions.put( key, action );
		}
	}

	public ActionBean getAction( String key )
	{
		if ( key != null && actions.containsKey( key ) )
		{
			return actions.get( key );
		}
		return null;
	}

	public IFilterHandler< Require > getFilterHandler()
	{
		return filterHandler;
	}

	public void setFilterHandler( IFilterHandler< Require > filterHandler )
	{
		this.filterHandler = filterHandler;
	}
}
